<template>
  <CartMain />
</template>
<script>
import CartMain from "@/pages/cart/components/CartMain.vue";

export default {
  components: { CartMain },
  onShow() {
    // 触发一个事件
    uni.$emit("onShow");
  },
  methods: {
    async getList(id) {
      return Promise.resolve([]);
    },
    async test() {
      const list = ["1", "3", "4", "5", "6"];
      const promiseList = list.map((id) => this.getList(id));
      for await (let i of promiseList) {
        console.log(i);
      }
      const slectedList = [
        { id: 1, name: "黑马" },
        { id: 2, name: "黑马" },
        { id: 3, name: "黑马" },
        { id: 14, name: "黑马" },
      ];
    },
  },
};
</script>
